<template>
  <main>
    <van-form @submit="onSubmit">
      <van-field
        v-model="username"
        name="用户名"
        label="用户名"
        placeholder="用户名"
        :rules="[{ required: true, message: '请填写用户名' }]"
      />
      <van-field
        v-model="password"
        type="password"
        name="密码"
        label="密码"
        placeholder="密码"
        :rules="[{ required: true, message: '请填写密码' }]"
      />
      <div style="margin: 16px;">
        <van-button round block type="info" native-type="submit">
          提交
        </van-button>
      </div>
    </van-form>
  </main>
</template>

<script>
import { sha256 } from 'utils/crypto'
import { Version } from 'api/index'

export default {
  name: 'home-view',
  data() {
    return {
      active: 'home',
      username: '',
      password: '',
    };
  },
  created() {
    this.name2 = sha256(this.name)
    Version()
    this.$emit('showTabMenu', false);
  },
  methods: {
    onSubmit(values) {
      console.log('submit', values);
    },
    handleClick () {
      // Toast.info('不错哟~')
    }
  },
  destroyed() {
    this.$emit('showTab', true);
  }
}
</script>

<style scoped>
  /* .heading {
    text-align: center;
    margin-bottom: 48px;
    h1 {
      color: #333;
      line-height: 1.15;
      font-size: 64px;
      margin-bottom: 32px;
      span {
        position: relative;
      }
    }
  } */
  .heading h1{
    font-size: 20px;
  }
  .heading h1 span::after {
    content: "";
    position: absolute;
    z-index: -1;
    left: 0;
    bottom: 8px;
    width: 100%;
    height: 20px;
    background: #ecf6ff;
  }
  .heading p {
    font-size: 16px;
    color: #666;
    line-height: 56px;
  }
</style>
